//
//  myHistoryController.m
//  iOS_NongLian
//
//  Created by n369 on 16/3/3.
//  Copyright © 2016年 NongLian. All rights reserved.
//

#import "myHistoryController.h"

@interface myHistoryController () <UITableViewDataSource, UITableViewDelegate> {
    UITableView * _tableView;
    NSMutableArray * _dataSource;
}

@end

@implementation myHistoryController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createNavigationBar:9];
    self.back.text = @"我的浏览历史";
    
    [self initData];
    [self createTableView];
}

- (void)initData {
    _dataSource = [[NSMutableArray alloc] initWithArray:@[@"1", @"1", @"1", @"1"]];
}

- (void)createTableView {
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 74, ScreenWidth, ScreenHeight - 118)];
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tableView.rowHeight = 100;
    _tableView.delegate = self;
    _tableView.dataSource = self;
    [self.view addSubview:_tableView];
    [self.view addSubview:[Factory createViewWithBackgroundColor:RGB(216, 216, 216) frame:CGRectMake(0, 74, ScreenWidth, 0.5)]];
}

#pragma mark tableViewDatasource&Delegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    //    return 3;
    return _dataSource.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    GoodCell * goodCell = [tableView dequeueReusableCellWithIdentifier:@"goodCell"];
//    if (!goodCell) {
//        goodCell = [[[NSBundle mainBundle] loadNibNamed:@"GoodCell" owner:self options:nil] lastObject];
//    }
    //    return goodCell;
    UITableViewCell * table = [[UITableViewCell alloc] init];
    return table;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"%ld", indexPath.row);
}

- (void)backTitleAction {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
